package com.hex.liyue.storemodule.presenter;

import com.hex.liyue.commonmodule.manager.HttpManager;
import com.hex.liyue.commonmodule.manager.UserManager;
import com.hex.liyue.commonmodule.net.ResponseListener;
import com.hex.liyue.commonmodule.utils.L;
import com.hex.liyue.storemodule.bean.FragmentStoreBean;


/**
 * Created by $cmm on 2016/6/21.
 * <p/>
 * 商城列表的业务类
 */
public class FragmentStorePresenter {
    private IFragmentStoreView iFragmentStoreView;

    public FragmentStorePresenter(IFragmentStoreView iFragmentStoreView) {
        this.iFragmentStoreView = iFragmentStoreView;
    }

    public void getStoreList(int page, int pagenum, boolean sortPrice) {
        HttpManager.getInstance().getStoreList(UserManager.getUserId(), page, pagenum, sortPrice, new ResponseListener<FragmentStoreBean>() {
            @Override
            public void onSuccess(FragmentStoreBean fragmentStoreBean) {
                iFragmentStoreView.setAdapter(fragmentStoreBean);
            }

            @Override
            public void onFailure(String responseresult) {
                iFragmentStoreView.showT(responseresult);
            }
        });
    }


}
